package com.nearby.demand.ui;

import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.TextView;

import com.auto.layout.lib.AutoLayoutActivity;
import com.easemob.chat.EMChatManager;
import com.nearby.demand.R;
import com.nearby.demand.ui.view.SttingView;
import com.nearby.demand.utils.SPUtil;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by IME on 2016/home_1/20.
 */
public class UiSetting extends AutoLayoutActivity implements SttingView {
    @Bind(R.id.tv_logout)
    TextView tv_logout;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.ui_setting, 1);
        ButterKnife.bind(this);

    }

    @Override
    public void onCreateCustomToolBar(Toolbar toolbar) {
        super.onCreateCustomToolBar(toolbar);
        //        toolbar.showOverflowMenu();
        toolbar.hideOverflowMenu();
        View view = getLayoutInflater().inflate(R.layout.toolbar_button_is_toolbar, toolbar);
        TextView textView = (TextView) view.findViewById(R.id.toolbar_title);
        textView.setText("设置");

    }

    @OnClick(R.id.tv_logout)
    public void logout() {
        SPUtil.putAndApply(UiSetting.this, "is_login", false);
        EMChatManager.getInstance().logout();
    }


}
